import request from '@/utils/request'

// 查询列表
export function GetListAPI (params) {
  return request({
    url: '/equipment/maintenance-work-order/list',
    method: 'GET',
    params
  })
}

// 新增
export function AddDataAPI (data) {
  return request({
    url: '/equipment/maintenance-work-order/add',
    method: 'POST',
    data
  })
}

// 修改
export function EditDataAPI (data) {
  return request({
    url: '/equipment/maintenance-work-order/updateWorkOrder',
    method: 'PUT',
    data
  })
}

// 查询单个
export function GetDeiltsAPI (params) {
  return request({
    url: '/equipment/maintenance-work-order/getView/' + params,
    method: 'GET'
  })
}

// 删除单个
export function DelDataAPI (params) {
  return request({
    url: '/equipment/maintenance-work-order/deleteWorkOrder/' + params,
    method: 'DELETE'
  })
}

// 派工
export function DispatchAPI (data) {
  return request({
    url: '/equipment/maintenance-work-order/dispatch',
    method: 'POST',
    data
  })
}

// 执行保养
export function ExecuteAPI (data) {
  return request({
    url: '/equipment/maintenance-work-order/execute',
    method: 'POST',
    data
  })
}

// 提交审核
export function AuditAPI (data) {
  return request({
    url: '/equipment/maintenance-work-order/audit',
    method: 'PUT',
    data
  })
}


// 撤销审核
export function RevocationAPI (data) {
  return request({
    url: '/equipment/maintenance-work-order/revocation/' + data,
    method: 'GET'
  })
}
/**
 * 批量撤销
 * @param {*} data 
 * @returns 
 */
export function RatchRevocationAPI (data) {
  return request({
    url: '/equipment/maintenance-work-order/batchRevocation',
    method: 'PUT',
    data
  })
}

/**
 * 列表
 * @returns
 */
export function GetTeaListAPI (params) {

  return request({
    url: '/system/sysTeam/getTeamGangedDdl',
    method: 'GET',
    params
  })
}
// 单据审核
export function DocumentAuditAPI (data) {
  return request({
    url: '/equipment/maintenance-work-order/documentAudit',
    method: 'POST',
    data
  })
}

/**
 * 批量提交
 * @param {*} data 
 * @returns 
 */
export function BatchAuditAPI (data) {
  return request({
    url: '/equipment/maintenance-work-order/batchAudit',
    method: 'POST',
    data
  })
}
//获取保养人员，保养负责人下拉数据
export function getDownUserAPI (params) {
  return request({
    url: '/system/userSaas/getDownUser',
    method: 'GET',
    params
  })
}

/**
 * 列表
 * @returns
 */
export function WorkOrderProjetAPI (params) {

  return request({
    url: '/equipment/maintenance-project/workOrderProject',
    method: 'GET',
    params
  })
}